package sample.Admin;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.stage.Stage;

public class Admin extends Application {//
    String username;
    String password;
    public  Admin(String u,String pass){
        username = u;
        password =pass;
    }
    public Admin(){

    }
    public void start(Stage primaryStage) throws  Exception{
        try{
            Parent root   = FXMLLoader.load(getClass().getResource("/fxml/admin.fxml"));
            Scene sc;
            Label name = (Label) root.lookup("#adm_main_lbl_aid");
            Label pass = (Label) root.lookup("#adm_main_lbl_psw");
            name.textProperty().setValue(username);
            pass.textProperty().setValue(password);
            sc = new Scene(root,600,440);
            primaryStage.setScene(sc);
            primaryStage.setTitle("管理端");
            primaryStage.setResizable(false);
            primaryStage.show();
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        launch(args);
    }

}
